<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SPHinXsys: SPH::StateEngine Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SPHinXsys
   &#160;<span id="projectnumber">alpha version</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespace_s_p_h.html">SPH</a></li><li class="navelem"><a class="el" href="class_s_p_h_1_1_state_engine.html">StateEngine</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="class_s_p_h_1_1_state_engine-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">SPH::StateEngine Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine_1_1_added_state_variable.html">AddedStateVariable</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Class for handling state variable added (allocated) by this <a class="el" href="class_s_p_h_1_1_state_engine.html">StateEngine</a>.  <a href="class_s_p_h_1_1_state_engine_1_1_added_state_variable.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateVariable</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_s_p_h_1_1_state_engine_1_1_state_variable_info.html">StateVariableInfo</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac170610813f82b2bcbc61d5bd5d9a361"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#ac170610813f82b2bcbc61d5bd5d9a361">addStateVariable</a> (std::string statevariablename, SimTK::Stage invalidatestage)</td></tr>
<tr class="separator:ac170610813f82b2bcbc61d5bd5d9a361"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15849e8e8d083de292f2293e4a7319b5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a15849e8e8d083de292f2293e4a7319b5">addStateVariable</a> (<a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateEngine::StateVariable</a> *statevariable)</td></tr>
<tr class="separator:a15849e8e8d083de292f2293e4a7319b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89e8e916c3dee636e79393fbbfb8ac01"><td class="memItemLeft" align="right" valign="top"><a id="a89e8e916c3dee636e79393fbbfb8ac01"></a>
SimTK::DefaultSystemSubsystem &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>getDefaultSubsystem</b> ()</td></tr>
<tr class="separator:a89e8e916c3dee636e79393fbbfb8ac01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa48ba98cdd33ac2ac0afced9bc1d734f"><td class="memItemLeft" align="right" valign="top"><a id="aa48ba98cdd33ac2ac0afced9bc1d734f"></a>
SimTK::DefaultSystemSubsystem &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>updDefaultSubsystem</b> ()</td></tr>
<tr class="separator:aa48ba98cdd33ac2ac0afced9bc1d734f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a641ee0d249be03f2d736491d26e30b31"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateVariable</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a641ee0d249be03f2d736491d26e30b31">traverseToStateVariable</a> (std::string &amp;pathname)</td></tr>
<tr class="separator:a641ee0d249be03f2d736491d26e30b31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a591831bee2ebf4824de2d1aa9c14a130"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbool.html">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a591831bee2ebf4824de2d1aa9c14a130">isAllStatesVariablesListValid</a> ()</td></tr>
<tr class="separator:a591831bee2ebf4824de2d1aa9c14a130"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a1f66b723c39a927bbe15c080ed34b0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a3a1f66b723c39a927bbe15c080ed34b0">StateEngine</a> (SimTK::MultibodySystem &amp;system)</td></tr>
<tr class="separator:a3a1f66b723c39a927bbe15c080ed34b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5462e5b2a0af58c3e3a2da57d3b3e6d"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#ab5462e5b2a0af58c3e3a2da57d3b3e6d">~StateEngine</a> ()</td></tr>
<tr class="separator:ab5462e5b2a0af58c3e3a2da57d3b3e6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8260627c299e94deed6936cbe93b34a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#aa8260627c299e94deed6936cbe93b34a">InitializeState</a> ()</td></tr>
<tr class="separator:aa8260627c299e94deed6936cbe93b34a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40116a6deb763c4e1097567eefe337d5"><td class="memItemLeft" align="right" valign="top">SimTK::MultibodySystem &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a40116a6deb763c4e1097567eefe337d5">getMultibodySystem</a> ()</td></tr>
<tr class="separator:a40116a6deb763c4e1097567eefe337d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35cdaa085bd64b45d03f8cfa0362d221"><td class="memItemLeft" align="right" valign="top">SimTK::MultibodySystem &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a35cdaa085bd64b45d03f8cfa0362d221">updMultibodySystem</a> ()</td></tr>
<tr class="separator:a35cdaa085bd64b45d03f8cfa0362d221"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae56518dd62545844d873785bbb940f9a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classint.html">int</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#ae56518dd62545844d873785bbb940f9a">getNumOfStateVariables</a> ()</td></tr>
<tr class="separator:ae56518dd62545844d873785bbb940f9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab9d432fc3e7f7d78c90ada278210c53"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classint.html">int</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#aab9d432fc3e7f7d78c90ada278210c53">getNumStateVariablesAddedByEngine</a> ()</td></tr>
<tr class="separator:aab9d432fc3e7f7d78c90ada278210c53"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0af58325ea42c683d84d0014bf3d6717"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_s_p_h_1_1_array.html">Array</a>&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a0af58325ea42c683d84d0014bf3d6717">getStateVariableNames</a> ()</td></tr>
<tr class="separator:a0af58325ea42c683d84d0014bf3d6717"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afce79f4008df22a52afbcefb3d5f651a"><td class="memItemLeft" align="right" valign="top">SimTK::Vector&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#afce79f4008df22a52afbcefb3d5f651a">getStateVariableValues</a> ()</td></tr>
<tr class="separator:afce79f4008df22a52afbcefb3d5f651a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ac69f512e683b7ae7b3c35472c054ca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a0ac69f512e683b7ae7b3c35472c054ca">reporter</a> (SimTK::State &amp;state_)</td></tr>
<tr class="separator:a0ac69f512e683b7ae7b3c35472c054ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a674027714cc0b6203b6686d6eee35697"><td class="memItemLeft" align="right" valign="top"><a id="a674027714cc0b6203b6686d6eee35697"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>writeStateInfoToXml</b> (<a class="el" href="classint.html">int</a> ite_rst_, const SimTK::State &amp;state_)</td></tr>
<tr class="separator:a674027714cc0b6203b6686d6eee35697"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b182432a7d8f66b8b03c3d06a2dfaf5"><td class="memItemLeft" align="right" valign="top">SimTK::State&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a6b182432a7d8f66b8b03c3d06a2dfaf5">readAndSetStateInfoFromXml</a> (<a class="el" href="classint.html">int</a> ite_rst_, SimTK::MultibodySystem &amp;system_)</td></tr>
<tr class="separator:a6b182432a7d8f66b8b03c3d06a2dfaf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Realize the Simbody System and State to Computational Stage.</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>Methods in this section enable advanced and scripting users access to realize the Simbody MultibodySystem and the provided state to a desired computational (realization) Stage. </p>
</div></td></tr>
<tr class="memitem:ab35384b5b1212dad64281acdd9641b7a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#ab35384b5b1212dad64281acdd9641b7a">realizeTime</a> ()</td></tr>
<tr class="separator:ab35384b5b1212dad64281acdd9641b7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abc3ea288e843ac3490b718fc42245b6f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#abc3ea288e843ac3490b718fc42245b6f">realizePosition</a> ()</td></tr>
<tr class="separator:abc3ea288e843ac3490b718fc42245b6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae599650ca1a77f91f0fa3f981d9b5a27"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#ae599650ca1a77f91f0fa3f981d9b5a27">realizeVelocity</a> ()</td></tr>
<tr class="separator:ae599650ca1a77f91f0fa3f981d9b5a27"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2b830d11e5ec1595ca9e4e8130d08eb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#ac2b830d11e5ec1595ca9e4e8130d08eb">realizeDynamics</a> ()</td></tr>
<tr class="separator:ac2b830d11e5ec1595ca9e4e8130d08eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33c923e5c533918756a00dae52eea33a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a33c923e5c533918756a00dae52eea33a">realizeAcceleration</a> ()</td></tr>
<tr class="separator:a33c923e5c533918756a00dae52eea33a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74d99f0f0c709f06b3ecd3c0648e4c57"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a74d99f0f0c709f06b3ecd3c0648e4c57">realizeReport</a> ()</td></tr>
<tr class="separator:a74d99f0f0c709f06b3ecd3c0648e4c57"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a027283fd00cf73fe956846d2023858ae"><td class="memItemLeft" align="right" valign="top">std::map&lt; std::string, <a class="el" href="struct_s_p_h_1_1_state_engine_1_1_state_variable_info.html">StateVariableInfo</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a027283fd00cf73fe956846d2023858ae">namedstatevariableinfo_</a></td></tr>
<tr class="separator:a027283fd00cf73fe956846d2023858ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d5aa02c961eea6c1f0b026ea78a842e"><td class="memItemLeft" align="right" valign="top">SimTK::Array_&lt; SimTK::ReferencePtr&lt; <a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateVariable</a> &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a0d5aa02c961eea6c1f0b026ea78a842e">allstatevariables_</a></td></tr>
<tr class="separator:a0d5aa02c961eea6c1f0b026ea78a842e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0bd04394577980e3da56abd62ffc4b9"><td class="memItemLeft" align="right" valign="top">SimTK::ReferencePtr&lt; SimTK::System &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#ad0bd04394577980e3da56abd62ffc4b9">statesassociatedsystem_</a></td></tr>
<tr class="separator:ad0bd04394577980e3da56abd62ffc4b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff3e9eb19aa13cf64795a0d2d4902c8a"><td class="memItemLeft" align="right" valign="top">SimTK::ReferencePtr&lt; SimTK::MultibodySystem &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#aff3e9eb19aa13cf64795a0d2d4902c8a">mbsystem_</a></td></tr>
<tr class="separator:aff3e9eb19aa13cf64795a0d2d4902c8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2955767698012d3e8e3fc0abac4367ff"><td class="memItemLeft" align="right" valign="top">SimTK::State&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a2955767698012d3e8e3fc0abac4367ff">working_state_</a></td></tr>
<tr class="separator:a2955767698012d3e8e3fc0abac4367ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c2396e0bb705a153bfee70b6ceb018b"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_p_h_1_1_state_engine.html#a8c2396e0bb705a153bfee70b6ceb018b">restart_folder_</a></td></tr>
<tr class="separator:a8c2396e0bb705a153bfee70b6ceb018b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:aecf6a41ead10eb6c5b344c3e2039cca9"><td class="memItemLeft" align="right" valign="top"><a id="aecf6a41ead10eb6c5b344c3e2039cca9"></a>
<a class="el" href="class_s_p_h_1_1_xml_engine.html">XmlEngine</a>&#160;</td><td class="memItemRight" valign="bottom"><b>simbody_xml_engine_</b></td></tr>
<tr class="separator:aecf6a41ead10eb6c5b344c3e2039cca9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a3a1f66b723c39a927bbe15c080ed34b0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3a1f66b723c39a927bbe15c080ed34b0">&#9670;&nbsp;</a></span>StateEngine()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPH::StateEngine::StateEngine </td>
          <td>(</td>
          <td class="paramtype">SimTK::MultibodySystem &amp;&#160;</td>
          <td class="paramname"><em>system</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Default constructor </p>

</div>
</div>
<a id="ab5462e5b2a0af58c3e3a2da57d3b3e6d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab5462e5b2a0af58c3e3a2da57d3b3e6d">&#9670;&nbsp;</a></span>~StateEngine()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual SPH::StateEngine::~StateEngine </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Destructor is virtual to allow concrete <a class="el" href="class_s_p_h_1_1_state_engine.html">StateEngine</a> to cleanup. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a15849e8e8d083de292f2293e4a7319b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a15849e8e8d083de292f2293e4a7319b5">&#9670;&nbsp;</a></span>addStateVariable() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SPH::StateEngine::addStateVariable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateEngine::StateVariable</a> *&#160;</td>
          <td class="paramname"><em>statevariable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The above method provides a convenient interface to this method, which automatically creates an '<a class="el" href="class_s_p_h_1_1_state_engine_1_1_added_state_variable.html" title="Class for handling state variable added (allocated) by this StateEngine.">AddedStateVariable</a>' and allocates resources in the SimTK::State for this variable. This interface allows the creator to add/expose state variables that are allocated by underlying Simbody components and specify how the state variable value is accessed by implementing a concrete <a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateVariable</a> and adding it to the <a class="el" href="class_s_p_h_1_1_state_engine.html">StateEngine</a> using this method. You may also want to create an Output for this state variable; see #OpenSim_DECLARE_OUTPUT_FOR_STATE_VARIABLE for more information. Reporters should use such an Output to get the <a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateVariable</a>'s value (instead of using getStateVariableValue()). </p>
<p>don't add state if there is another state variable with the same name.</p>
<p>assign a "slot" for a state variable by name state variable index will be invalid by default upon allocation during realizeTopology the index will be set</p>

</div>
</div>
<a id="ac170610813f82b2bcbc61d5bd5d9a361"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac170610813f82b2bcbc61d5bd5d9a361">&#9670;&nbsp;</a></span>addStateVariable() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SPH::StateEngine::addStateVariable </td>
          <td>(</td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>statevariablename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">SimTK::Stage&#160;</td>
          <td class="paramname"><em>invalidatestage</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Add a continuous system state variable belonging to this Engine, and assign a name by which to refer to it. Changing the value of this state variable will automatically invalidate everything at and above its <em>invalidatesStage</em>, which is normally Stage::Dynamics meaning that there are forces that depend on this variable. If you define one or more of these variables you must also override computeStateVariableDerivatives() to provide time derivatives for them. Note, all corresponding system indices are automatically determined using this interface. As an advanced option you may choose to hide the state variable from being accessed outside of this component, in which case it is considered to be "hidden". You may also want to create an Output for this state variable; see #OpenSim_DECLARE_OUTPUT_FOR_STATE_VARIABLE for more information. Reporters should use such an Output to get the <a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateVariable</a>'s value (instead of using getStateVariableValue()).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">stateVariableName</td><td>string value to access variable by name </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">invalidatesStage</td><td>the system realization stage that is invalidated when variable value is changed </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">isHidden</td><td>flag (bool) to optionally hide this state variable from being accessed outside this component as an Output </td></tr>
  </table>
  </dd>
</dl>
<p>Allocate space for a new state variable.</p>

</div>
</div>
<a id="a40116a6deb763c4e1097567eefe337d5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40116a6deb763c4e1097567eefe337d5">&#9670;&nbsp;</a></span>getMultibodySystem()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimTK::MultibodySystem &amp; SPH::StateEngine::getMultibodySystem </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the underlying MultibodySystem that this <a class="el" href="class_s_p_h_1_1_state_engine.html">StateEngine</a> is connected to. Make sure you have called Model::initSystem() prior to accessing the System. Throws an <a class="el" href="class_s_p_h_1_1_exception.html" title="A class for basic exception functionality.">Exception</a> if the System has not been created or the <a class="el" href="class_s_p_h_1_1_state_engine.html">StateEngine</a> has not added itself to the System. </p><dl class="section see"><dt>See also</dt><dd>hasSystem(). <br  />
 </dd></dl>

</div>
</div>
<a id="ae56518dd62545844d873785bbb940f9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae56518dd62545844d873785bbb940f9a">&#9670;&nbsp;</a></span>getNumOfStateVariables()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classint.html">int</a> SPH::StateEngine::getNumOfStateVariables </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the number of "continuous" state variables maintained by the State Engine. </p>

</div>
</div>
<a id="aab9d432fc3e7f7d78c90ada278210c53"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aab9d432fc3e7f7d78c90ada278210c53">&#9670;&nbsp;</a></span>getNumStateVariablesAddedByEngine()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classint.html">int</a> SPH::StateEngine::getNumStateVariablesAddedByEngine </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Get the number of continuous states that the State Engine added to the underlying computational system. </p>

</div>
</div>
<a id="a0af58325ea42c683d84d0014bf3d6717"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0af58325ea42c683d84d0014bf3d6717">&#9670;&nbsp;</a></span>getStateVariableNames()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_s_p_h_1_1_array.html">Array</a>&lt; std::string &gt; SPH::StateEngine::getStateVariableNames </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the names of "continuous" state variables maintained by the Engine </p>

</div>
</div>
<a id="afce79f4008df22a52afbcefb3d5f651a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afce79f4008df22a52afbcefb3d5f651a">&#9670;&nbsp;</a></span>getStateVariableValues()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimTK::Vector SPH::StateEngine::getStateVariableValues </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get all values of the state variables allocated by this <a class="el" href="class_s_p_h_1_1_state_engine.html">StateEngine</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">state</td><td>the State for which to get the value </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Vector of state variable values of length getNumStateVariables() in the order returned by <a class="el" href="class_s_p_h_1_1_state_engine.html#a0af58325ea42c683d84d0014bf3d6717">getStateVariableNames()</a> </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">StateEngineHasNoSystem</td><td>if this object has not been added to a System (i.e., if initSystem has not been called) </td></tr>
  </table>
  </dd>
</dl>
<p>if the StateVariables are invalid, rebuild the list.</p>

</div>
</div>
<a id="aa8260627c299e94deed6936cbe93b34a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8260627c299e94deed6936cbe93b34a">&#9670;&nbsp;</a></span>InitializeState()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SPH::StateEngine::InitializeState </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set up the working state in presetn engine </p>
<p>Clear cached list of all related StateVariables if any from a previousSystem.</p>
<p>Set the model's operating state (internal member variable) to the default state that is stored inside the System.</p>
<p>Process the modified modeling option.</p>
<p>Realize instance variables that may have been set above. This means floating point parameters such as mass properties and geometry placements are frozen.</p>
<p>Realize the initial configuration in preparation. This initial configuration does not necessarily satisfy constraints.</p>

</div>
</div>
<a id="a591831bee2ebf4824de2d1aa9c14a130"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a591831bee2ebf4824de2d1aa9c14a130">&#9670;&nbsp;</a></span>isAllStatesVariablesListValid()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classbool.html">bool</a> SPH::StateEngine::isAllStatesVariablesListValid </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Check that the list of _allStateVariables is valid. </p>
<p>Consider the list of all StateVariables to be valid if all of the following conditions are true:</p><ol type="1">
<li>a System has been associated with the list of StateVariables</li>
<li>The list of all StateVariables is correctly sized (initialized)</li>
<li>The System associated with the StateVariables is the current System</li>
</ol>

</div>
</div>
<a id="a6b182432a7d8f66b8b03c3d06a2dfaf5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b182432a7d8f66b8b03c3d06a2dfaf5">&#9670;&nbsp;</a></span>readAndSetStateInfoFromXml()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimTK::State SPH::StateEngine::readAndSetStateInfoFromXml </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classint.html">int</a>&#160;</td>
          <td class="paramname"><em>ite_rst_</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">SimTK::MultibodySystem &amp;&#160;</td>
          <td class="paramname"><em>system_</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>read state infor from xml and set it to sate. For all bodies in the matter system, their generalized coordinates, generalized velocities and transformations of the origin points are read from the restart file </p>

</div>
</div>
<a id="a33c923e5c533918756a00dae52eea33a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a33c923e5c533918756a00dae52eea33a">&#9670;&nbsp;</a></span>realizeAcceleration()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SPH::StateEngine::realizeAcceleration </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Perform computations that may depend on applied forces. </p>

</div>
</div>
<a id="ac2b830d11e5ec1595ca9e4e8130d08eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac2b830d11e5ec1595ca9e4e8130d08eb">&#9670;&nbsp;</a></span>realizeDynamics()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SPH::StateEngine::realizeDynamics </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Perform computations (typically forces) that may depend on dynamics-stage state variables, and on computations performed in earlier stages (including velocity, position, and time), but not on other forces, accelerations, constraint multipliers, or reaction forces. </p>

</div>
</div>
<a id="abc3ea288e843ac3490b718fc42245b6f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc3ea288e843ac3490b718fc42245b6f">&#9670;&nbsp;</a></span>realizePosition()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SPH::StateEngine::realizePosition </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Perform computations that depend only on position-level state variables and computations performed in earlier stages (including time). </p>

</div>
</div>
<a id="a74d99f0f0c709f06b3ecd3c0648e4c57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a74d99f0f0c709f06b3ecd3c0648e4c57">&#9670;&nbsp;</a></span>realizeReport()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SPH::StateEngine::realizeReport </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Perform computations that may depend on anything but are only used for reporting and cannot affect subsequent simulation behavior. </p>

</div>
</div>
<a id="ab35384b5b1212dad64281acdd9641b7a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab35384b5b1212dad64281acdd9641b7a">&#9670;&nbsp;</a></span>realizeTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SPH::StateEngine::realizeTime </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Perform computations that depend only on time and earlier stages. </p>

</div>
</div>
<a id="ae599650ca1a77f91f0fa3f981d9b5a27"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae599650ca1a77f91f0fa3f981d9b5a27">&#9670;&nbsp;</a></span>realizeVelocity()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SPH::StateEngine::realizeVelocity </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Perform computations that depend only on velocity-level state variables and computations performed in earlier stages (including position, and time). </p>

</div>
</div>
<a id="a0ac69f512e683b7ae7b3c35472c054ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ac69f512e683b7ae7b3c35472c054ca">&#9670;&nbsp;</a></span>reporter()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SPH::StateEngine::reporter </td>
          <td>(</td>
          <td class="paramtype">SimTK::State &amp;&#160;</td>
          <td class="paramname"><em>state_</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>report the state info by requested. </p>

</div>
</div>
<a id="a641ee0d249be03f2d736491d26e30b31"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a641ee0d249be03f2d736491d26e30b31">&#9670;&nbsp;</a></span>traverseToStateVariable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateEngine::StateVariable</a> * SPH::StateEngine::traverseToStateVariable </td>
          <td>(</td>
          <td class="paramtype">std::string &amp;&#160;</td>
          <td class="paramname"><em>pathname</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get a <a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateVariable</a> anywhere in the state engine, given a <a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateVariable</a> path. This returns nullptr if a <a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateVariable</a> does not exist at the specified path or if the path is invalid. </p>

</div>
</div>
<a id="a35cdaa085bd64b45d03f8cfa0362d221"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35cdaa085bd64b45d03f8cfa0362d221">&#9670;&nbsp;</a></span>updMultibodySystem()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimTK::MultibodySystem&amp; SPH::StateEngine::updMultibodySystem </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get writable reference to the MultibodySystem that this component is connected to. </p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a0d5aa02c961eea6c1f0b026ea78a842e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0d5aa02c961eea6c1f0b026ea78a842e">&#9670;&nbsp;</a></span>allstatevariables_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">SimTK::Array_&lt;SimTK::ReferencePtr&lt;<a class="el" href="class_s_p_h_1_1_state_engine_1_1_state_variable.html">StateVariable</a>&gt; &gt; SPH::StateEngine::allstatevariables_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">mutable</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p><a class="el" href="class_s_p_h_1_1_array.html">Array</a> of all state variables for fast access during simulation. </p>

</div>
</div>
<a id="aff3e9eb19aa13cf64795a0d2d4902c8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aff3e9eb19aa13cf64795a0d2d4902c8a">&#9670;&nbsp;</a></span>mbsystem_</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimTK::ReferencePtr&lt;SimTK::MultibodySystem&gt; SPH::StateEngine::mbsystem_</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reference pointer to the system that this engine manage. </p>

</div>
</div>
<a id="a027283fd00cf73fe956846d2023858ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a027283fd00cf73fe956846d2023858ae">&#9670;&nbsp;</a></span>namedstatevariableinfo_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::map&lt;std::string, <a class="el" href="struct_s_p_h_1_1_state_engine_1_1_state_variable_info.html">StateVariableInfo</a>&gt; SPH::StateEngine::namedstatevariableinfo_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">mutable</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Map names of continuous state variables of the Engine to their underlying SimTK indices. </p>

</div>
</div>
<a id="a8c2396e0bb705a153bfee70b6ceb018b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c2396e0bb705a153bfee70b6ceb018b">&#9670;&nbsp;</a></span>restart_folder_</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string SPH::StateEngine::restart_folder_</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Write the state data to xml file. For all bodies in the matter system, their generalized coordinates, generalized velocities and transformations of the origin points are written in the output file </p>

</div>
</div>
<a id="ad0bd04394577980e3da56abd62ffc4b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad0bd04394577980e3da56abd62ffc4b9">&#9670;&nbsp;</a></span>statesassociatedsystem_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">SimTK::ReferencePtr&lt;SimTK::System&gt; SPH::StateEngine::statesassociatedsystem_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">mutable</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>A handle the System associated with the above state variables. </p>

</div>
</div>
<a id="a2955767698012d3e8e3fc0abac4367ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2955767698012d3e8e3fc0abac4367ff">&#9670;&nbsp;</a></span>working_state_</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimTK::State SPH::StateEngine::working_state_</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This is the internal 'writable' state of the engine. working_state_ will be set to the system default state when initializeState() is called. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>SPHINXsys/src/shared/simbody/<a class="el" href="state__engine_8h_source.html">state_engine.h</a></li>
<li>SPHINXsys/src/shared/simbody/state_engine.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
